/* color palette from <https://github.com/vuejs/theme> */
/*
    1. 背景颜色
    2. 文字颜色
    3. 边框颜色
    4. 悬浮颜色
    5. 激活颜色
    6. 禁用颜色
    7. 警告颜色
    8. 错误颜色
    9. 成功颜色

    1. 文字大小
*/
:root {
    --vt-c-white: #ffffff;
    --vt-c-white-soft: #f8f8f8;
    --vt-c-white-mute: #f2f2f2;

    --vt-c-black: #181818;
    --vt-c-black-soft: #222222;
    --vt-c-black-mute: #282828;

    --vt-c-indigo: #2c3e50;

    --vt-c-divider-light-1: rgba(60, 60, 60, 0.29);
    --vt-c-divider-light-2: rgba(60, 60, 60, 0.12);
    --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65);
    --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48);

    --vt-c-text-light-1: var(--vt-c-indigo);
    --vt-c-text-light-2: rgba(60, 60, 60, 0.66);
    --vt-c-text-dark-1: var(--vt-c-white);
    --vt-c-text-dark-2: rgba(235, 235, 235, 0.64);
    scrollbar-gutter: stable;
    --v-transparent: 0.9;
}

/* semantic color variables for this project */
:root[theme="light"] {
    --color-background-window: var(--vt-c-white-mute);
    --color-background: rgba(255, 255, 255, var(--v-transparent));
    --color-background-soft: var(--vt-c-white-soft);
    --color-background-mute: var(--vt-c-white-mute);

    --color-background-mask: rgba(235, 235, 235, 0.64);

    --color-background-btn: #e4e9ec;
    --color-background-input: #e4e9ec;

    --color-border: var(--vt-c-divider-light-2);
    --color-border-hover: var(--vt-c-divider-dark-2);

    --color-heading: var(--vt-c-text-light-1);
    --color-text: var(--vt-c-text-light-1);
    --sender-btn-color-text: #2CFF38;

    --section-gap: 160px;
    --hover-color: #e4e9ec;

    --color-background-pinned: #E3F2FD;
}

:root[theme="dark"] {
    --color-background-window: var(--vt-c-black-mute);
    --color-background: rgba(0, 0, 0, var(--v-transparent));
    --color-background-soft: var(--vt-c-black-soft);
    --color-background-mute: var(--vt-c-black-mute);


    --color-background-mask: rgba(235, 235, 235, 0.64);

    --color-background-pinned: #181818;

    --color-background-btn: black;
    --color-background-input: var(--vt-c-black);

    --color-border: var(--vt-c-black-soft);
    --color-border-hover: var(--vt-c-black);

    --color-heading: var(--vt-c-text-dark-1);
    --color-text: var(--vt-c-text-dark-1);
    --sender-btn-color-text: #fff;
    --hover-color: #3d3d3d;
}

/* prevent pull-to-refresh for Safari 16+ */
@media screen and (pointer: coarse) {
    @supports (-webkit-backdrop-filter: blur(1px)) and (overscroll-behavior-y: none) {
        html {
            min-height: 100.3%;
            overscroll-behavior-y: none;
        }
    }
}

/* prevent pull-to-refresh for Safari 9~15 */
@media screen and (pointer: coarse) {
    @supports (-webkit-backdrop-filter: blur(1px)) and (not (overscroll-behavior-y: none)) {
        html {
            height: 100%;
            overflow: hidden;
        }

        body {
            margin: 0px;
            max-height: 100%;
            /* or `height: calc(100% - 16px);` if body has default margin */
            overflow: auto;
            -webkit-overflow-scrolling: touch;
        }

        /* in this case to disable pinch-zoom, set `touch-action: pan-x pan-y;` on `body` instead of `html` */
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    width: 100vw;
    height: 100vh;
    scroll-behavior: smooth;
    user-select: none;
    color: var(--color-text);
    background-image: url('./images/home-background.jpg');
    background-size: cover;
    transition: color 0.5s;
    line-height: 1.6;
    font-size: medium;
    font-family: Inter,
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        Roboto,
        Oxygen,
        Ubuntu,
        Cantarell,
        'Fira Sans',
        'Droid Sans',
        'Helvetica Neue',
        sans-serif;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    touch-action: pan-x pan-y;
    min-height: 100%;
}

body {
    overscroll-behavior-y: none;
    overscroll-behavior-x: none;
}

input {
    color: inherit;
}

#friend-card-dialog {
    position: absolute;
    background-color: var(--color-background);
    box-shadow: 10px 10px 15px rgba(60, 60, 60, 0.12),
        10px 10px 10px rgba(60, 60, 60, 0.12),
        -10px -10px 15px rgba(60, 60, 60, 0.12),
        -10px -10px 15px rgba(60, 60, 60, 0.12);
    border: none;
    outline: none;
    user-select: none;

    &::backdrop {
        background-color: transparent;
    }
}

.box-shadow {
    box-shadow: 10px 10px 15px rgba(60, 60, 60, 0.12),
        10px 10px 10px rgba(60, 60, 60, 0.12),
        -2px -2px 15px rgba(60, 60, 60, 0.12),
        -1px -1px 15px rgba(60, 60, 60, 0.12);
}

.pointer {
    cursor: pointer;
}

.add-conv-size {
    width: 90%;
    height: 80%;
    max-width: 20rem;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: .3rem;
    position: absolute;
}

.add-conv-size-mobile {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

.add-conv {
    padding: 1rem;
    background-color: var(--color-background);
    overflow: hidden;
    z-index: 10;

    &[tabindex] {
        outline: none;
    }

    .empty-result {
        text-align: center;
        width: 100%;
    }

    >fieldset {
        width: 100%;
        height: 100%;
        padding: 1rem;
        display: flex;
        flex-direction: column;
        gap: .5rem;
        border-radius: .3rem;
    }

    .item {
        width: 100%;
        height: 2rem;
        display: flex;
        gap: 1rem;
        align-items: center;
        justify-content: center;

        input[type="checkbox"] {
            border-radius: 50%;
            cursor: pointer;
        }

        .item-card {
            width: 80%;
            height: 2rem;
            line-height: 2rem;
            display: flex;
            align-items: center;
            gap: .5rem;
            cursor: pointer;
            overflow: hidden;
            text-overflow: ellipsis;
            word-break: keep-all;
            font-size: .8rem;
            color: var(--color-text);
            white-space: nowrap;

            >img {
                width: 2rem;
                height: 2rem;
                border-radius: .3rem;
            }
        }
    }

    /* select friends dialog action */

    .add-conv-actions {
        width: 100%;
        height: 2rem;
        line-height: 2rem;
        position: absolute;
        bottom: 2rem;
        left: 0;
        display: flex;
        align-items: center;
        justify-content: space-evenly;

        >div {
            width: 5rem;
            height: 2rem;
            background-color: var(--color-background-btn);
            border-radius: .3rem;
            text-align: center;
            cursor: pointer;
        }
    }
}

/* 朋友卡片 */

.friend-card {
    width: 22rem;
    display: flex;
    flex-direction: column;
    padding: 1rem;
    position: fixed;
    background-color: var(--color-background);
    border-radius: .3rem;
    gap: 1rem;
    z-index: 3;

    &[tabindex] {
        outline: none;
    }

    &> :not(:last-child) {
        border-bottom: 1px solid #ccc;
    }


    .friend-card-header {
        width: 100%;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 1rem;
        padding-bottom: 1rem;
    }

    .friend-card-avatar {
        width: 4rem;
        height: 4rem;
        border-radius: .3rem;
    }

    .friend-card-info {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        word-wrap: break-word;
        overflow: hidden;
        white-space: pre-wrap;
        color: var(--color-text);

        /* &:not(:first-child) {
            color: #999;
        } */
    }

    .friend-card-body {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;

        button {
            width: 6rem;
            height: 2rem;
            padding: auto;
            cursor: pointer;
            border: none;
            border-radius: .2rem;
            background-color: #2ecc71;
            color: white;
        }

        .apply-detail {
            width: 100%;
            height: auto;
            display: flex;
            flex-direction: column;
            gap: 1rem;

            .apply-input {
                /* border-radius: .3rem; */
                outline: none;
                padding: 0 .3rem;
                /* font-size: 1rem; */
            }

            > :first-child,
            > :nth-child(2) {
                display: grid;
                grid-template-columns: 1fr 2fr;
            }

            > :last-child {
                display: grid;
                grid-template-columns: 1fr 1fr;
                justify-items: center;
            }
        }
    }
}

.action {
    width: 100%;
    display: flex;
    justify-content: space-evenly;
    height: 5rem;

    div {
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: .3rem;
        cursor: pointer;
        flex-direction: column;
        font-size: small;
        color: #90CBFB;

        svg {
            width: 2rem;
            height: 2rem;

            path,
            circle {
                stroke-width: 2;
                stroke: #90CBFB !important;
            }

        }
    }
}

/* 图片预览 */
.img-preview {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--color-background-mask);

    img {
        max-width: 100%;
        max-height: 100%
    }
}

/* 头像:本人头像以及聊天列表中的头像尺寸 */
.avatar {
    width: calc(4rem - 1.5rem);
    height: calc(4rem - 1.5rem);
    border-radius: .3rem;
}

/* 左侧顶部搜索栏 */
.top-bar {
    display: flex;
    align-items: center;
    width: 100%;
    height: 4rem;
    padding: 1rem;
    gap: 1rem;

    .plus-icon {
        width: 2rem;
        height: 2rem;
        display: flex;
        justify-content: center;
        align-items: center;
        font-size: small;
        cursor: pointer;

        svg {
            path {
                stroke: var(--color-text);
            }
        }
    }

    .plus-icon-mobile {
        width: 2rem;
        height: 2rem;
        position: absolute;
        bottom: 2rem;
        right: 2rem;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        background-color: rgb(250, 92, 92);
        border-radius: 50%;
        box-shadow: 3px 3px 1px 1px rgba(0, 0, 0, 0.2);
        font-size: small;

        svg {
            path {
                stroke: white;
            }
        }
    }

    .search {
        width: 100%;
        height: 1.5rem;

        .search-icon {
            position: absolute;
            width: 1.5rem;
            height: 1.5rem;
            display: flex;
            justify-content: center;
            align-items: center;
            padding-top: .4rem;

            svg {
                width: 1rem;
                height: 1rem;

                path {
                    stroke: var(--color-text);
                }
            }
        }

        .search-input {
            width: 100%;
            height: 100%;
            border: none;
            outline: none;
            padding: 0.5rem 0.5rem 0.5rem 2rem;
            background-color: var(--color-background-input);
            border-radius: .5rem;
        }
    }
}

.hover {
    &:hover {
        background-color: var(--hover-color);
    }
}

.info-panel-size {
    width: 21rem;
    height: 34rem;
    position: fixed;
    top: 50%;
    left: 50%;
    border-radius: .3rem;
    transform: translate(-50%, -50%);
    padding: 1rem;

    &[tabindex] {
        outline: none;
    }
}

.info-panel-size-mobile {
    width: 100%;
    height: 100%;
    position: fixed;
    padding: 1rem;
    padding-top: 3rem;
    top: 0;
    left: 0;
}

.info-panel {
    background-color: var(--color-background);
    z-index: 3;
    overflow-y: auto;

    .info-panel-item-avatar {
        width: 100%;
        height: 4rem;
        margin-bottom: .5rem;
        display: flex;
        justify-content: center;
        align-items: center;

        label {
            position: relative;
            width: 4rem;
            height: 4rem;
            display: flex;

        }

        span {
            position: absolute;
            width: 100%;
            height: 50%;
            color: var(--color-text);
            background-color: var(--color-background-mask);
            bottom: 0;
            left: 0;
            display: flex;
            justify-content: center;
            align-items: center;
        }
    }

    img {
        width: 100%;
        height: 100%;
        border-radius: .2rem;
    }

    .info-panel-item {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 2.5fr;
        height: 3rem;
        align-items: center;

        input {
            width: 100%;
            padding: .3rem .5rem;
            border: none;
            border-radius: .2rem;
            background-color: var(--color-background-input);
            font-size: medium;
        }

        .info-panel-item-gender {
            width: 100%;
            display: flex;
            justify-content: space-evenly;
            align-items: center;

            label {
                display: flex;
                justify-content: center;
                align-items: center;
                gap: .1rem;
            }
        }
    }

    .info-panel-btn {
        width: 100%;
        height: 3rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 3rem;

        button {
            width: 5rem;
            height: 2rem;
            background-color: var(--color-background-btn);
            color: var(--color-text);
            border: none;
            border-radius: .2rem;
            cursor: pointer;
        }
    }

}

.avatar-setter {
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    z-index: 888;
}

.btn {
    width: 6rem;
    height: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    background-color: var(--color-background-btn);
}

/* switch plugin */
.switch {
    --width: 3rem;
    --height: 1.2rem;
    --child-width: 1rem;
    --child-height: 1rem;
    --child-margin: calc((var(--height) - var(--child-height)) / 2);
    display: inline-block;
    width: var(--width);
    height: var(--height);
    border-radius: var(--height);
    background-color: var(--color-background);
    position: relative;
    transition: .5s;
    border: #181818 1px solid;

    .slider {
        display: inline-block;
        width: var(--child-width);
        height: var(--child-height);
        position: absolute;
        margin: var(--child-margin);
        left: 0;
        border-radius: 50%;
        background-color: var(--color-background-btn);
        transition: .5s;
    }

    .left {
        left: 0;
    }

    .right {
        left: calc(var(--width) - var(--child-width) - var(--child-margin) * 2);
    }
}

.background-change {
    background-color: var(--color-background);
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 6px;
    /*滚动条的宽度*/
    height: 8px;
    /*滚动条的高度*/
}


::-webkit-scrollbar-thumb:vertical {
    /*垂直滚动条的样式*/
    height: 50px;
    background-color: #BDBDBD;
    -webkit-border-radius: 50px;
    outline: none;
    /*outline-offset: -2px;*/
    border: none;
}

.notification-container {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;

    .size {
        width: 15rem;
        height: 7rem;
    }

    .size-mobile {
        width: 40%;
        height: 5rem;
    }

    .loading {
        width: 100%;
        height: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: .3rem;
        background-color: rgba(0, 0, 0, 0.5);
        box-shadow: 0 3px 5px rgb(184, 184, 184);
        color: white;
    }
}
